import {DatePicker, Form} from "antd";
import BaseEntity from "@/type/BaseEntity";
import InputProps from "@/common/form/porps";
import {useEffect} from "react";
// import dayjs from 'dayjs';
import {DATETIME_FORMAT} from "@/global/constant.ts";
interface IProps<T extends BaseEntity> extends InputProps<T>{
    a?:string
}

const InputDateTime = <T extends BaseEntity>(props: IProps<T>) => {

    // const form = Form.useFormInstance<T>();

    useEffect(() => {
        // console.log(form.getFieldsValue(),dayjs());
        // form.setFieldValue(props.name as any, dayjs());
    },[]);

    return (
       <Form.Item<T> name={props.name as any} label={props.label} required={props.required}>
           <DatePicker showTime format={DATETIME_FORMAT} disabled={props.disabled}/>
       </Form.Item>
    );
};

export default InputDateTime;